package com.itheima.lambda;

public class LambdaDemo1 {
    public static void main(String[] args) {
        ShowHandler showHandler=new ShowHandler(){
          public  void show(){
              System.out.println("匿名内部类1");
          }
        };
        new ShowHandler(){
            public  void show(){
                System.out.println("匿名内部类2");
            }
        }.show();
        useShowHandler(showHandler);
        useShowHandler(new ShowHandler(){
            public  void show(){
                System.out.println("匿名内部类3");
            }
        });
        useShowHandler(()->System.out.println("Lambda表达式"));
    }
    public static void useShowHandler(ShowHandler showHandler){
      showHandler.show();
    }
}
